﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="PPARSearch.aspx.cs" Inherits="PPAP.Web.SearchReport.PPARSearch" %>
<%@ Register Assembly="AspNetPager" Namespace="Wuqi.Webdiyer" TagPrefix="webdiyer" %>
<%@ Register Assembly="PPAP.WebControls" Namespace="PPAP.WebControls" TagPrefix="cc1" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title></title>
     <script src="../Common/My97DatePicker/WdatePicker.js" type="text/javascript"></script>
</head>
<body>
    <form id="Form1" runat="server">
    <div>
        <table width="100%" style="border-color: #2A48CE; border: 1px; border-style: solid;
            border-color: Gray; border-spacing: 0px;">
            <tr style="height: 32px;">
                <td style="font-weight: bold;" bgcolor="#D7D7D7" colspan="4">
                    PPAR History Filter SET
                </td>
            </tr>
            <tr>
                <td class="titlename" width="15%">
                    Part No.:
                </td>
                <td width="35%">
                    <cc1:PartNo ID="tbPartno" runat="server" />
                </td>
                <td class="titlename" width="15%">
                    Supplier code:
                </td>
                <td width="35%">
                    <asp:TextBox autocomplete="off"   ID="tbSupplierNo" runat="server"></asp:TextBox>
                </td>
            </tr>
            <tr>
                <td class="titlename">
                    Create from:
                </td>
                <td class="titlename">
                    <cc1:My97 ID="DatePicker1" runat="server"></cc1:My97>

                    to:<cc1:My97 ID="DatePicker2" runat="server"></cc1:My97>
                </td>
                <td class="titlename">
                    Sampling reason:
                </td>
                <td>
                    <asp:TextBox autocomplete="off"   ID="tbSamplingReason" runat="server"></asp:TextBox>
                </td>
            </tr>
            <tr>
                <td class="titlename">
                    Version:
                </td>
                <td>
                    <asp:TextBox autocomplete="off"   ID="tbVersion" runat="server"></asp:TextBox>
                </td>
                <td class="titlename">
                    Status:
                </td>
                <td>
                    <asp:DropDownList ID="ddlStatus" runat="server" Width="155px">
                        <asp:ListItem Value="-1">All</asp:ListItem>
                        <asp:ListItem Value="8">Un-allocated</asp:ListItem>
                        <asp:ListItem Value="0">Allocated</asp:ListItem>                      
                        <asp:ListItem Value="1">Created</asp:ListItem>
                        <asp:ListItem Value="2">Submitted</asp:ListItem>
                        <asp:ListItem Value="3">Ready for sampling</asp:ListItem>
                        <asp:ListItem Value="4">Not ready for sampling</asp:ListItem>
                        <asp:ListItem Value="5">Circulating</asp:ListItem>
                        <asp:ListItem Value="6">Released</asp:ListItem>
                        <asp:ListItem Value="7">Decided</asp:ListItem>
                    </asp:DropDownList>
                </td>
            </tr>
            <tr>
                <td align="left" colspan="4" class="titlename">
                    <asp:CheckBox ID="chkMycase" runat="server" Text="My case" />
                    &nbsp;
                </td>
            </tr>
            <tr>
                <td align="right" colspan="4"><asp:Button ID="btnSubmit" CssClass="button" runat="server" Text="Search" OnClick="btnSubmit_Click" />
                &nbsp;
                    <asp:Button ID="btnExport" CssClass="button" runat="server" Text="Export" 
                        OnClick="btnExport_Click" />
                </td>
            </tr>
        </table>
        <br />
        <asp:DataGrid ID="dgList" HeaderStyle-BackColor="#2E8AC5" HeaderStyle-Font-Bold="true"
            HeaderStyle-Height="32px" Width="100%" AllowSorting="true" OnLoad="dgLoad" AutoGenerateColumns="False"
            runat="server" onsortcommand="dgList_SortCommand">
            <Columns>
                <asp:BoundColumn DataField="rownum" HeaderText="No." FooterText="No.">
                    <ItemStyle HorizontalAlign="Left"></ItemStyle>
                </asp:BoundColumn>
                <asp:BoundColumn DataField="bdntpartno" SortExpression="bdntpartno" HeaderText="Part No." FooterText="Part No.">
                    <ItemStyle HorizontalAlign="Left"></ItemStyle>
                </asp:BoundColumn>
                <asp:BoundColumn DataField="pparno" SortExpression="pparno" HeaderText="PPAR No." FooterText="PPAR No.">
                    <ItemStyle HorizontalAlign="Left"></ItemStyle>
                </asp:BoundColumn>
                <asp:BoundColumn DataField="qlevel" SortExpression="qlevel" HeaderText="Q/E level" FooterText="Q/E level">
                    <ItemStyle HorizontalAlign="Left"></ItemStyle>
                </asp:BoundColumn>
                <asp:BoundColumn DataField="ShowStatus" HeaderText="Status" FooterText="Status">
                    <ItemStyle HorizontalAlign="Left"></ItemStyle>
                </asp:BoundColumn>
                <asp:BoundColumn DataField="suppliercode" SortExpression="suppliercode" HeaderText="Suppiler code" FooterText="Suppiler code">
                    <ItemStyle HorizontalAlign="Left"></ItemStyle>
                </asp:BoundColumn>
                <asp:BoundColumn DataField="PPARVERSION" HeaderText="PPAR version" Visible="false">
                    <ItemStyle HorizontalAlign="Left"></ItemStyle>
                </asp:BoundColumn>
                <asp:TemplateColumn HeaderText="Start date" FooterText="Start date" SortExpression="ppardate">
                    <ItemStyle HorizontalAlign="Left"></ItemStyle>
                    <ItemTemplate>
                        <asp:Label ID="Label7" runat="server" Text='<%#Eval("ppardate").ToString()==""?"":DateTime.Parse(Eval("ppardate").ToString()).ToString("yyyy-MM-dd")  %>'></asp:Label>
                    </ItemTemplate>
                </asp:TemplateColumn>
                <asp:TemplateColumn HeaderText="End date" FooterText="End date" SortExpression="endtime">
                    <ItemStyle HorizontalAlign="Left"></ItemStyle>
                    <ItemTemplate>
                        <asp:Label ID="Label8" runat="server" Text='<%#Eval("endtime").ToString()==""?"":DateTime.Parse(Eval("endtime").ToString()).ToString("yyyy-MM-dd")  %>'></asp:Label>
                    </ItemTemplate>
                </asp:TemplateColumn>
                <asp:BoundColumn DataField="FINALRESULT" SortExpression="FINALRESULT" HeaderText="Result" FooterText="Result">
                    <ItemStyle HorizontalAlign="Left"></ItemStyle>
                </asp:BoundColumn>
                <asp:BoundColumn DataField="remarks" SortExpression="remarks" HeaderText="Remark" FooterText="Remark">
                    <ItemStyle HorizontalAlign="Left"></ItemStyle>
                </asp:BoundColumn>
                <asp:TemplateColumn  ItemStyle-HorizontalAlign="Left" HeaderStyle-HorizontalAlign="Left"  HeaderText="View" FooterText="View">
                    <ItemTemplate>
                        <asp:ImageButton ID="ImageButton2" CssClass="tt" ToolTip='view' PostBackUrl='<%# "../Part/CreatPPARWeb.aspx?rid="+Eval("ID")+"&his=1" %>'
                            ImageUrl='../Images/newimg/see.png' runat="server" />
                    </ItemTemplate>
                </asp:TemplateColumn>
            </Columns>
            <HeaderStyle BackColor="#E7E8E8" Font-Bold="True" Height="32px"></HeaderStyle>
        </asp:DataGrid>
         <webdiyer:AspNetPager ID="AspNetPager2"  runat="server" Width="100%" CssClass="paginator"
                                ShowPageIndexBox="Always" 
            PageIndexBoxType="DropDownList" TextBeforePageIndexBox="goto"
                                HorizontalAlign="Center" PageSize="20" EnableTheming="true" 
                        AlwaysShow="True" FirstPageText="|&lt;"
                                LastPageText="&gt;|" NextPageText="&gt;" 
                        PrevPageText="&lt;" SubmitButtonText="Go"
                                TextAfterPageIndexBox="page" 
                        InvalidPageIndexErrorMessage="Page index is not effective numerical！" 
                        onpagechanged="AspNetPager2_PageChanged" 
                        PageIndexOutOfRangeErrorMessage="Page index beyond range" 
            BackColor="#E7E8E8" >
                            </webdiyer:AspNetPager>
    </div>
    </form>
</body>
</html>
